package com.yuju.order.enums;

/**
 * 
 * 类名：invoiceReturnCodeEnum  <br />
 *
 * 功能：功能：发票业务代码枚举
 *
 * @author : sunyl <br />
 * @Date : 2017年11月23日 上午10:40:51  <br />
 * @version : 1.1 <br />
 */
public enum InvoiceReturnCodeEnum {
	INVOICE_QUERY_SUCCESS("yuju-invoice-1000", "发票信息查询成功"),
	INVOICE_QUERY_FAILURE("yuju-invoice-1001", "发票信息查询失败"),
	INVOICE_SAVE_SUCCESS("yuju-invoice-1002", "发票信息保存成功"),
	INVOICE_SAVE_FAILURE("yuju-invoice-1003", "发票信息保存失败"),
	INVOICE_UPDATE_SUCCESS("yuju-invoice-1004", "发票信息更新成功"),
	INVOICE_UPDATE_FAILURE("yuju-invoice-1005", "发票信息更新失败"),
	INVOICE_DEL_SUCCESS("yuju-invoice-1006", "发票信息删除成功"),
	INVOICE_DEL_FAILURE("yuju-invoice-1007", "发票信息删除失败"),
	INVOICE_UPDATE_OUT_FAILURE("yuju-invoice-1008", "发票信息更新失败，开票时间超过48小时");
	
	private String code;
	private String desc;
	
	InvoiceReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (InvoiceReturnCodeEnum enume : InvoiceReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}